<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>JS02</title>
    </head>
    <body>


        <script>

            function exec(func){
                func();
            }
            
            function fn1(){
                console.log("------------------>fn1");
            }
            
            var f1 = fn1;

            //f1();

            exec(fn1);

            var f2 = function(){
                console.log('============================>f2');
            };

            f2();

            (function(a,b){
                console.log('========================>匿名函数'+a+b);
            })(5,"xxx");

            exec(function(){
                console.log("pppppppppppppppppppppppppppppp");
            });

            setTimeout(function(){
                console.log("xxxxxxxxxxxxxxxx");
            },1000);

            setTimeout(function(){alert('===')},1000);



            var f3 = function(){
                return function(){
                    console.log('Hello!');
                };
            };

            f3()();



            var f4 = function(){
                console.log('------------------------------');
                for(var arg of arguments){
                    console.log(arg);
                }
                console.log('------------------------------');
            };

            f4(4,5);

        </script>



    </body>


</html>